package com.ce.common.util;

import android.util.Base64;

import java.io.UnsupportedEncodingException;

/**
 * Created by LiLongHui on 2017/7/26.
 */

public class Base64Util {

    public static String re(String myString){
        return myString.replaceAll("\r|\n", "");
    }

    public static String getBase64String(String string) {
        try {
            return re(Base64.encodeToString(re(string).getBytes("UTF-8"), Base64.DEFAULT));
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }


}
